import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Form/index';
const operationList = [
  {
    label: '只读',
    value: 0,
  },
  {
    label: '可选',
    value: 1,
  },
  {
    label: '必选',
    value: 2,
  },
];
export const otherSettingsColumns: BasicColumn[] = [
  {
    title: '角色/步骤',
    dataIndex: 'name',
  },
  {
    title: '显示名称',
    dataIndex: 'showName',
  },
  {
    title: '操作类型',
    dataIndex: 'operationPermissions',
    width: 110,
    customRender: ({ record }) => {
      return operationList[record.operationPermissions]?.label || '';
    },
  },
  {
    title: '类别',
    dataIndex: 'type',
    width: 110,
    customRender: ({ record }) => {
      return record.type === 1 ? '步骤' : '角色';
    },
  },
];
export const flowSchemas: FormSchema[] = [
  {
    field: 'showName',
    component: 'Input',
    label: '显示名称',
    colProps: {
      span: 20,
    },
  },
  {
    field: 'operationPermissions',
    component: 'RadioGroup',
    label: '选择',
    colProps: {
      span: 20,
    },
    componentProps: {
      options: operationList,
    },
  },
];
